﻿<?xml version="1.0" encoding="UTF-8"?>
<wml2:Collection xmlns:wml2="http://www.opengis.net/waterml/2.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:gml="http://www.opengis.net/gml/3.2" 
    xmlns:om="http://www.opengis.net/om/2.0"
    xmlns:sa="http://www.opengis.net/sampling/2.0" 
    xmlns:swe="http://www.opengis.net/swe/2.0"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns:sf="http://www.opengis.net/sampling/2.0"
    xmlns:sams="http://www.opengis.net/samplingSpatial/2.0"
    xsi:schemaLocation="http://www.opengis.net/waterml/2.0 ../Schemas/WaterML/waterml2.xsd" 
    gml:id="observation_example_1">
    <gml:description>A handcrafted example of USGS data from Lk Houston, 
        see for data http://waterdata.usgs.gov/nwis/dv?cb_00010=on&amp;cb_00010=on&amp;cb_00010=on&amp;format=html&amp;begin_date=2011-04-04&amp;end_date=2011-05-05&amp;site_no=295554095093401&amp;referred_module=sw
        
        The data describes two temperature sensors deployed at different heights in the river at the same monitoring point. I've implemented the 
        vertical using approach #3 described in the conceptual model discussion about capturing vertical offsets. The other alternatives would be
        in the process description, in the result block or as seperate monitoring points. 
    </gml:description>
    <wml2:metadata>
        <wml2:DocumentMetadata gml:id="doc">
            
            <wml2:generationDate>2011-08-24T10:46:00+10:00</wml2:generationDate>
            <wml2:version xlink:href="http://www.opengis.net/waterml/2.0"/>
        </wml2:DocumentMetadata>
    </wml2:metadata>
    
    <wml2:phenomenaDictionary>
        <gml:Dictionary gml:id="USGS_phenom_codes">
            <gml:identifier codeSpace="http://waterdata.usgs.gov/nwis">phenom_codes_dict</gml:identifier>
            <gml:dictionaryEntry>
                <gml:Definition gml:id="usgs_water_temp">
                    <gml:identifier codeSpace="http://waterdata.usgs.gov/nwis/parameters">00010</gml:identifier>
                    <gml:name codeSpace="http://waterdata.usgs.gov/nwis/parameters">Temperature, water, degrees Celsius</gml:name>
                    <gml:remarks>USGS code for water temperature in celsius as adapted from http://waterdata.usgs.gov/nwis</gml:remarks>
                </gml:Definition>
            </gml:dictionaryEntry>
        </gml:Dictionary>
    </wml2:phenomenaDictionary>
    
    <wml2:qualifierDictionary>
        <gml:Dictionary gml:id="USGS_qualifier_codes">
            <gml:identifier codeSpace="http://waterdata.usgs.gov/nwis/help/?">qualifier_codes_dict</gml:identifier>
            <gml:dictionaryEntry>
                <gml:Definition gml:id="usgs_provisional">
                    <gml:identifier codeSpace="http://waterdata.usgs.gov/nwis/help/?">provisional</gml:identifier>
                    <gml:name codeSpace="http://waterdata.usgs.gov/nwis/parameters">P</gml:name>
                    <gml:remarks>Provisional data subject to revision.</gml:remarks>
                </gml:Definition>
            </gml:dictionaryEntry>
        </gml:Dictionary>
    </wml2:qualifierDictionary>
    
    <wml2:samplingFeatureMember>
        <wml2:MonitoringPoint gml:id="MP_295554095093401">
            <gml:identifier codeSpace="http://waterdata.usgs.gov/nwis">295554095093401</gml:identifier>
            <gml:name codeSpace="http://waterdata.usgs.gov/nwis">Lk Houston at mouth of Jack's Ditch nr Houston</gml:name>
            <sf:sampledFeature xlink:href="http://en.wikipedia.org/wiki/Lake_Houston"/>
            <sams:shape>
                <gml:Point gml:id="loc_lk_houston">
                    <gml:pos srsName="ESPG:4326">29.958833 -95.148833</gml:pos>
                </gml:Point>
            </sams:shape>
            <wml2:descriptionReference xlink:href="http://waterdata.usgs.gov/nwis/inventory/?site_no=295554095093401&amp;agency_cd=USGS"/>
        </wml2:MonitoringPoint>
    </wml2:samplingFeatureMember>
    
    <wml2:observationMember>
        <om:OM_Observation gml:id="obs_13">
            <om:phenomenonTime>
                <gml:TimePeriod gml:id="tp_1">
                    <!-- Timezone: CDT -5 UTC -->
                    <gml:beginPosition>2011-04-04T00:00:00-05:00</gml:beginPosition>
                    <gml:endPosition>2011-04-08T00:00:00-05:00</gml:endPosition>
                </gml:TimePeriod>
            </om:phenomenonTime>
            
            <!-- The time the CSV values were generated from NWIS --> 
            <om:resultTime>
                <gml:TimeInstant gml:id="result_generated_from_site_time">
                    <gml:timePosition>2011-08-23T21:41:39-05:00</gml:timePosition>
                </gml:TimeInstant>
            </om:resultTime>
            
            <!-- values have been temporally averaged. Link back to original sensor information is provided -->
            <om:procedure>
                <wml2:ObservationProcess gml:id="temporal_aggregation">
                    <wml2:processType xlink:href="http://www.opengis.net/def/processType/WaterML/2.0/Algorithm"/>
                    <wml2:originatingProcess xlink:href="http://www.usgs.com/sensors/temp_sensor/sensor1234_1ft" 
                        xlink:role="http://www.opengis.net/def/processType/WaterML/2.0/Sensor"/>
                    <wml2:aggregationPeriod>P1D</wml2:aggregationPeriod>
                </wml2:ObservationProcess>
            </om:procedure>
            
            <!-- Uses approach #3 (from diagrams) of specifying vertical offset --> 
            <om:parameter>
                <om:NamedValue>
                    <om:name xlink:href="http://www.opengis.net/def/waterml/2.0/vertical_offset"/>
                    <om:value xsi:type="gml:MeasureType" uom="ft">1.0</om:value>
                </om:NamedValue>
            </om:parameter>
            
            <!-- references the internal dictionary code --> 
            <om:observedProperty xlink:href="#usgs_water_temp" xlink:title="Temperature, water, degrees Celsius"/>
            
            <!-- reference monitoring point described in collection above --> 
            <om:featureOfInterest xlink:href="#MP_295554095093401"/>
            
            <om:result>
                <wml2:Timeseries gml:id="ts_13">
                    <wml2:temporalExtent xlink:href="#tp_1"/>
                    <wml2:metadata>
                        <wml2:TSMetadata>
                            <wml2:cumulative>false</wml2:cumulative>
                            <!-- Daily values --> 
                            <wml2:aggregationDuration>P1D</wml2:aggregationDuration>
                        </wml2:TSMetadata>
                    </wml2:metadata>
                    
                    <wml2:defaultPointMetadata>
                        <wml2:DefaultTVPMetadata>
                            <wml2:interpolationType xlink:href="http://www.opengis.net/def/timeseriesType/WaterML/2.0/AveragePrec" 
                                xlink:title="Average in preceeding"/>
                            <wml2:qualifier xlink:href="#usgs_provisional" xlink:title="Provisional subject to revision."/>
                            <wml2:uom uom="ft"/>
                        </wml2:DefaultTVPMetadata>
                    </wml2:defaultPointMetadata>
                    <wml2:point>
                        <wml2:TimeValuePairMeasure>
                            <!-- as discussed, where to specify time if it's a daiy average? -->  
                            <wml2:time>2011-04-04T00:00:00-05:00</wml2:time>
                            <wml2:value>21.7</wml2:value>
                        </wml2:TimeValuePairMeasure>
                    </wml2:point>
                    <wml2:point>
                        <wml2:TimeValuePairMeasure>
                            <wml2:time>2011-04-05T00:00:00-05:00</wml2:time>
                            <wml2:value>21.7</wml2:value>
                        </wml2:TimeValuePairMeasure>
                    </wml2:point>
                    <wml2:point>
                        <wml2:TimeValuePairMeasure>
                            <wml2:time>2011-04-06T00:00:00-05:00</wml2:time>
                            <wml2:value xsi:nil="true" nilReason="missing"></wml2:value>
                            <wml2:metadata>
                                <wml2:TVPMetadata>
                                    <wml2:comment>Interpreted point as missing</wml2:comment>
                                </wml2:TVPMetadata>
                            </wml2:metadata>
                        </wml2:TimeValuePairMeasure>
                    </wml2:point>
                    <wml2:point>
                        <wml2:TimeValuePairMeasure>
                            <wml2:time>2011-04-07T00:00:00-05:00</wml2:time>
                            <wml2:value xsi:nil="true" censorReason="http://www.opengis/def/WaterML/2.0/belowDetectionThreshhold"/>
                            <wml2:metadata>
                                <wml2:TVPMetadata>
                                    <wml2:comment>This point is not really censored, I've added as an example</wml2:comment>
                                </wml2:TVPMetadata>
                            </wml2:metadata>
                        </wml2:TimeValuePairMeasure>
                    </wml2:point>
                    <wml2:point>
                        <wml2:TimeValuePairMeasure>
                            <wml2:time>2011-04-08T00:00:00-05:00</wml2:time>
                            <wml2:value>22.0</wml2:value>
                        </wml2:TimeValuePairMeasure>
                    </wml2:point>
                    <wml2:point>
                        <wml2:TimeValuePairMeasure>
                            <wml2:time>2011-04-09T00:00:00-05:00</wml2:time>
                            <wml2:value>22.6</wml2:value>
                        </wml2:TimeValuePairMeasure>
                    </wml2:point>
                </wml2:Timeseries>                
            </om:result>
        </om:OM_Observation>
    </wml2:observationMember>
    
    <wml2:observationMember>
        <om:OM_Observation gml:id="obs_14">
            <om:phenomenonTime>
                <gml:TimePeriod gml:id="tp_2">
                    <!-- Timezone: CDT -5 UTC -->
                    <gml:beginPosition>2011-04-04T00:00:00-05:00</gml:beginPosition>
                    <gml:endPosition>2011-04-08T00:00:00-05:00</gml:endPosition>
                </gml:TimePeriod>
            </om:phenomenonTime>
            <!-- The time the CSV values were generated from NWIS --> 
            <om:resultTime xlink:href="#result_generated_from_site_time"/>
            
            <!-- values have been temporally averaged. Link back to original sensor information is provided -->
            <om:procedure>
                <wml2:ObservationProcess gml:id="temporal_aggregation_6ft">
                    <wml2:processType xlink:href="http://www.opengis.net/def/processType/WaterML/2.0/Algorithm"/>
                    <wml2:originatingProcess xlink:href="http://www.usgs.com/sensors/temp_sensor/sensor1234_6ft" 
                        xlink:role="http://www.opengis.net/def/processType/WaterML/2.0/Sensor"/>
                    <wml2:aggregationPeriod>P1D</wml2:aggregationPeriod>
                </wml2:ObservationProcess>
            </om:procedure>
            
            <!-- Uses approach #3 (from diagrams) of specifying vertical offset -->
            <om:parameter>
                <om:NamedValue>
                    <om:name xlink:href="http://www.opengis.net/def/waterml/2.0/vertical_offset"/>
                    <om:value xsi:type="gml:MeasureType" uom="ft">6.0</om:value>
                </om:NamedValue>
            </om:parameter>
            
            <!-- references the internal dictionary code --> 
            <om:observedProperty xlink:href="#usgs_water_temp" xlink:title="Temperature, water, degrees Celsius"/>
            
            <!-- reference monitoring point described in collection above --> 
            <om:featureOfInterest xlink:href="#MP_295554095093401"/>
            <om:result>
                <wml2:Timeseries gml:id="ts_14">
                    <wml2:temporalExtent xlink:href="#tp_1"/>
                    <wml2:metadata>
                        <wml2:TSMetadata>
                            <wml2:cumulative>false</wml2:cumulative>
                            <!-- Daily values --> 
                            <wml2:aggregationDuration>P1D</wml2:aggregationDuration>
                        </wml2:TSMetadata>
                    </wml2:metadata>
                    
                    <wml2:defaultPointMetadata>
                        <wml2:DefaultTVPMetadata>
                            <wml2:interpolationType xlink:href="ttp://www.opengis.net/def/timeseriesType/WaterML/2.0/AveragePrec" 
                                xlink:title="Average in preceeding interval"/>
                            <wml2:qualifier xlink:href="#usgs_provisional" xlink:title="Provisional subject to revision."/>
                            <wml2:uom uom="ft"/>
                        </wml2:DefaultTVPMetadata>
                    </wml2:defaultPointMetadata>
                    <wml2:point>
                        <wml2:TimeValuePairMeasure>
                            <wml2:time>2011-04-04T00:00:00-05:00</wml2:time>
                            <wml2:value>21.7</wml2:value>
                        </wml2:TimeValuePairMeasure>
                    </wml2:point>
                    <wml2:point>
                        <wml2:TimeValuePairMeasure>
                            <wml2:time>2011-04-05T00:00:00-05:00</wml2:time>
                            <wml2:value>21.1</wml2:value>
                            <wml2:metadata>
                                <wml2:TVPMetadata>
                                    <wml2:comment>0.6 degrees cooler 5ft down</wml2:comment>
                                </wml2:TVPMetadata>
                            </wml2:metadata>
                        </wml2:TimeValuePairMeasure>
                    </wml2:point>
                    <wml2:point>
                        <wml2:TimeValuePairMeasure>
                            <wml2:time>2011-04-06T00:00:00-05:00</wml2:time>
                            <wml2:value xsi:nil="true" nilReason="missing"></wml2:value>
                            <wml2:metadata>
                                <wml2:TVPMetadata>
                                    <wml2:comment>Interpreted point as missing</wml2:comment>
                                </wml2:TVPMetadata>
                            </wml2:metadata>
                        </wml2:TimeValuePairMeasure>
                    </wml2:point>
                    <wml2:point>
                        <wml2:TimeValuePairMeasure>
                            <wml2:time>2011-04-07T00:00:00-05:00</wml2:time>
                            <wml2:value>21.3</wml2:value>
                        </wml2:TimeValuePairMeasure>
                    </wml2:point>
                    <wml2:point>
                        <wml2:TimeValuePairMeasure>
                            <wml2:time>2011-04-08T00:00:00-05:00</wml2:time>
                            <wml2:value>22.0</wml2:value>
                        </wml2:TimeValuePairMeasure>
                    </wml2:point>
                    <wml2:point>
                        <wml2:TimeValuePairMeasure>
                            <wml2:time>2011-04-09T00:00:00-05:00</wml2:time>
                            <wml2:value>22.5</wml2:value>
                        </wml2:TimeValuePairMeasure>
                    </wml2:point>
                </wml2:Timeseries>             
            </om:result>
        </om:OM_Observation>
    </wml2:observationMember>  
</wml2:Collection>
